# set1=set()
# set2=set()
# for i in range(1,n+1):
#     if n%i==0:
#         set1.add(i)
# for i in range(1,m+1):
#     if m%i==0:
#         set2.add(i)
# print(set1,set2)
# print(set1^set2)

n = int(input('>>>>>'))
m = int(input('>>>>>'))
set1 = set()
set2 = set()
if n > m:
    max1 = n
else:
    max1 = m
for i in range(1, max1 + 1):
    if n % i == 0:
        set1.add(i)
    if m % i == 0:
        set2.add(i)
print(set1 ^ set2)

l = [5, 74, 1, 4, 8, ]
print(sorted(l))
